package hit.reports;

/**
 * Represents a Paragraph item in the Report.
 *
 */
public class BuilderParagraph extends BuilderObject {

	/**
	 * The text to be displayed
	 */
	private String value;

	/**
	 * Default Constructor
	 */
	public BuilderParagraph()
	{
		value = "";
	}
	
	/**
	 * Constructs a new Paragraph with an inital value.
	 * @param newValue The initial value of the paragraph.
	 * @throws IllegalArgumentException If the new value is null.
	 */
	public BuilderParagraph(String newValue) throws IllegalArgumentException
	{
		if (newValue == null)
			throw new IllegalArgumentException();
		
		value = new String(newValue);
	}
	
	/**
	 * Gets the value of the paragraph.
	 * @return The value of the paragraph.
	 */
	public String getValue() {
		return value;
	}

	/**
	 * Sets the value of the paragraph.
	 * @param value The new value for the paragraph.
	 * @throws IllegalArgumentException if the value is null.
	 */
	public void setValue(String value) throws IllegalArgumentException
	{
		if (value == null)
			throw new IllegalArgumentException();
			
		this.value = value;
	}
}
